Relational Expressive Power of Local Generic Queries

نویسندگان

  • Oleg V. Belegradek
  • Alexei P. Stolboushkin
  • Michael A. Taitslin
چکیده

Consider a scheme of databases Q and two signatures: L0 = f c, or x = c where x is a variable and c is a name of an element of U is called simple. A relation R is said to be simple if it can be nitely represented as a conjunction of disjunctions of simple formulas. R is said to be { 4 { prime if it is representable in the formî x there exist P -separable u; v 2 U such that x u y, x v y. An element x of U is said to be a right boundary point of a prime relation P i for each y 2 U; y < x there exist P -separable u; v 2 U such that x u y, x v y. An element is a boundary point of P i it is a right or left boundary point of P . It can be observed that any boundary point of P is a constant in de nition of P or has such a constant as his adjacent. So the set of the boundary points for each prime relation P is nite and can be expressed as an restricted query. Denote this query by P (x). If a constant is not a boundary point of P , it is possible to de ne P not using the constant. So we will suppose that any constant in a de nition of P is a boundary point of P . Every quanti er-free formula representing a relation P of arity k can always be represented as a disjunction of the following form: _ 2Rk( ^ ); where Rk is a collection of all the maximal conjunctions of equalities and comparisons between x1; x2; : : : ; xk, and is a quanti er-free formula in which inter-variable comparisons or equalities are not used. Then for every 2 Rk, ^ P can be easily encoded by a prime relation (of possibly a smaller arity). The union of the sets of the boundary points of the prime relations ^ P for all 2 Rk is the set of the boundary points of P . For a nite representable state, the set of the boundary points of the state is the union of the sets of the boundary points of all the database relations of the state. A query Q is locally generic over nitely representable states i for any partial monotone mapping from the union of the set of the boundary points of a nitely representable state s and fa1; : : : ; akg in U , if query Q transforms a database state s into a relation R and R(a1; : : : ; ak) is true then Q transforms (s) into such a relation S that S( (a1); : : : ; (ak)) { 5 { is true. A de nition of the state (s) is obtained from a de nition of s by replacing every constant c in the de nition with (c). The problem is that a restricted query may not be locally generic for nitely representable states. 2 RESTRICTED vs. EXTENDED Let Q be the set of the rational numbers. The goal of this section is to compare restricted and generic extended queries from the viewpoint of their expressive power over hQ; <;=i. We start from showing that, generally speaking, + does add to the expressive power of FO query language, even for Boolean queries: Theorem 2.1 The niteness of the database state is expressible by an extended query but is not expressible by any restricted query. Proof: The fact that the query is generic is obvious. To express it, rst recall that the active domain AD of the database state (that is, the elements present in the database state) is expressible by an FO query. Let AD(x) be this query. The d.b. state is nite i AD is nite. Observe now that a set of rational numbers is nite i the following two conditions hold: 1. the set fully belongs to an interval, and 2. there is a rational quantity r > 0 such that any two distinct elements in the set are at least r apart from one another. Therefore, we can express this query as: (9ulr > 0)((8x)(AD(x) ! (l < x^x < u))^(8xy)((AD(x)^AD(y)^x < y) ! x+r < y)): Here, the \x+ r < y" is an obvious abbreviation. Of course the boundedness of AD is expressed in the rst part of the formula without +; we claim, however that the constant-separation is not expressible without +. Formally, we claim that if a Boolean restricted query holds in every nite database state, it also holds in an in nite state that belongs to an interval and consists of isolated points. A formal proof of this can be carried out for a database scheme consisting of a single unary relation by applying a Fra ss e-Taimanov-Ehrenfeucht game. This part is omitted from the current abstract. Q.E.D. Note that the technique in this theorem is Q-speci c, and cannot be carried out for, say, real numbers. Corollary 2.2 Extended querying is more expressible than restricted one w.r.t. Boolean generic queries. { 6 { 2.1 Locally generic extended queries over nite d.b. states Theorem 2.3 An extended query of arity k is equal for all the nite database states over U to a restricted query i is generic for all the pseudonite database states over V . Proof: If is equal for all the nite database states over U to a restricted query , is equal to for all the pseudonite states over V . But and all the other restricted queries are stable under order automorphisms of V . Let is not equal over nite states to any restricted query. Let ! is the set of all the natural numbers. Let ( n : n < !) be an enumeration of all L+0 -formulas, that is, all z yi > z ^ xi < z yi < z)! ! (P (~x) P (~y))! : The following lemma is then obvious. Lemma 2.9 A relation P is simple i there exists a nite set R of elements of U such that P is R-invariant. An interval [x; y] is a set fz : x z yg. Lemma 2.10 Let P be a prime relation. If r; q are P -separable and r < q, then the interval [r; q] contains a boundary point of P . Let be a formula, P be a relation symbol, and let be a formula of the same arity as P . By hP i we denote the result of substitution of for all occurrences of P in . As usual, this may require renaming of variables. Lemma 2.11 For any database scheme there exist another database scheme , T = ;, and FO formulas f PgP2 of the scheme , and f PgP2 of the scheme , P of the arity of P , such that for any nitely representable -state for any P 2 : 1. P yields a simple answer 2. for any P 2 , (8~x) P h Q QiQ2 (~x) P (~x) holds in every nitely representable state. Proof: It su ces to show (2) for prime database states only. Indeed, every quanti er-free formula representing a relation P of arity k can always be represented as a disjunction of the following form: _ 2Rk( ^ ); { 9 { where Rk is a collection of all the maximal conjunctions of equalities and comparisons between x1; x2; : : : ; xk, and is a quanti er-free formula in which inter-variable comparisons or equalities are not used. Then for every 2 Rk, ^ P can be easily encoded by a prime relation (of possibly a smaller arity). For every P 2 , include the relation symbol P of the same arity k into . De ne P (x1; x2; : : : ; xk) as follows: (9y1y2 : : : yk) (8z) P (z) ! k̂ i=1((xi > z yi > z) ^ (xi < z yi < z))! ^ P (y1; y2; : : : ; yk)! : Essentially, P (x1; x2; : : : ; xk) extends P (x1; x2; : : : ; xk) to a relation invariant w.r.t. the set of boundary points of P . Denote x1 < x2 < : : : < xk by P . Obviously, answers to P (x1; x2; : : : ; xk) will not necessarily satisfy P . Since the set of boundary points of a prime relation is nite (Lemma 2.10), and P (x1; x2; : : : ; xk) yields an invariant relation w.r.t. the set of boundary points of P , this answer is simple (Lemma 2.9). Notice that P ^ P (x1; x2; : : : ; xk) is equivalent to P (x1; x2; : : : ; xk). Clearly, P implies P ^ P . Let P ^ P (a1; a2; : : : ; ak) and :P (a1; a2; : : : ; ak). Then there exist b1; b2; : : : ; bk, and i k such that: 1. a1; a2; : : : ; ak and b1; b2; : : : ; bk are positioned the same way w.r.t. the set of boundary points of P 2. for all j = 1; 2; : : : ; k 1, aj < aj+1 and bj < bj+1 3. P (b1; b2; : : : ; bk), but :P (a1; a2; : : : ; ak) 4. a1 = b1; : : : ; ai 1 = bi 1, and ai < bi (the case ai > bi is similar) If ai; bi were P -separable then by Lemma 2.10 there would be a boundary point between ai and bi|a contradiction. Otherwise a1; a2; : : : ; ak and a1; a2; : : : ; ai; bi+1; : : : ; bk satisfy the same four conditions as above for i+ 1. Hence, we can de ne P as ^ P : This proves the lemma. Q.E.D. For a simple relation P of an arity k, de ne the relation x 6'P y of P -separability as follows: (9i < k)(9x1x2 : : : xi 1xi+1 : : : xk) (P (x1; x2; : : : ; xi 1; x; xi+1; : : : ; xk) 6 P (x1; x2; : : : ; xi 1; y; xi+1; : : : ; xk)): Lemma 2.12 For any database scheme there exist another database scheme , T = ;, and FO formulas f PgP2 of the scheme , and f PgP2 of the scheme , P of the arity of P , such that for any simple -state for any P 2 : 1. P yields a nite answer { 10 {2. for any P 2 , (8~x) P h QQiQ2 (~x) P (~x) holds for every simple stateProof: Take any relation symbol P 2 . By assumption, a nite representation for P is aquanti er-free rst order formula whose atomic formulas are either equalities or comparisonsbetween variables on one side and constants on the other. Consider the ( nite!) set B ofboundary points of P . The formula (x) that would express this set is easy to write using6'P . Clearly, P is B-invariant, and therefore, the behavior of P can be explained in terms ofB. Formally, we will introduce 3k new relation symbols fPgg of the same arity as P indexedwith sequences of f<;>;=g of length k. These new relations are going to be de ned assubset of Bk, and will therefore be nite.< in ith position in the index indicates that the boundary point in this position the entireinterval of inseparable elements immediately preceding the point. Similarly, > indicates theinterval following this point, and = indicates the point itself. For example, for a ternary P ,P=<=(x; y; z) can be written as follows:(x) ^ (y) ^ (z)^(8u) ((u < y ^ (8v)( (v)^ v < y ! v < u)) ! P (x; u; z)) :In the opposite direction, P can be reconstructed using all fPgg and their active domain.Technical details are left to the reader. Q.E.D.The following main theorem follows from Lemmas 2.11, 2.12:Theorem 2.13 For any database scheme there exist another database scheme , T =;, and FO formulas f PgP2 of the scheme , and f PgP2 of the scheme , P of the arityof P , such that for any nitely representable -state for any P 2 :1. P yields a nite answer2. for any P 2 , (8~x) P h QQiQ2 (~x) P (~x) holds for every nitely representable stateTheorem 2.14 Let U be an o-minimal structure, the additive group of the integer numbers,or the additive semigroup of the natural numbers. For example, U can be a divisible orderedAbelian group. So, for example, U can be a group of rational or real numbers. Let (~x) bea locally generic over nitely representable states extended query. There exists an restrictedquery (~x) that is equivalent to (~x) over nitely representable database states.Proof: Using Theorem 2.11, rewrite the query (~x) to a query 0(~x) over a new signature, such that:there are formulas f PgP2 over the initial signature with the property (~x) ()0 h PPiP2 (~x), andfor any P 2 , P yields a nite answer { 11 {By Theorem 2.5 and Theorem 2.8, 0 is equivalent to a restricted formula 0 over all nited.b. states. Then, 0 h PPiP2 (~x) is a restricted formula equivalent to (~x). Denote thisformula by .Q.E.D.References[1] M. Benedikt, G. Dong, L. Libkin, and L. Wong. Relational expressive power of constraintquery languages. Manuscript, 1995.[2] C. C. Chang and H. J. Keisler. Model theory. North Holland, 1990.[3] S. Grumbach and J. Su. Finitely representable databases. In Proc. 13th ACM Symp.on Principles of Database Systems, 1994.[4] S. Grumbach and J. Su. Dense-order constraint databases. In Proc. 14th ACM Symp.on Principles of Database Systems, pages 66{77, 1995.[5] S. Grumbach, J. Su, and C. Tollu. Linear constraint databases. In Proc. Logic and Com-putational Complexity (LCC'94), Springer-Verlag Lecture Notes in Computer Science,1995. To appear.[6] P.C. Kanellakis and D.Q. Goldin. Constraint programming and database query lan-guages. In Proc. International Symposium on Theoretical Aspects of Computer Software(TACS'94), pages 96{120, 1994.[7] P.C. Kanellakis, G.M. Kuper, and P.Z. Revesz. Constraint query languages. In Proc.9th ACM Symp. on Principles of Database Systems, pages 299{313, 1990.[8] P.C. Kanellakis, G.M. Kuper, and P.Z. Revesz. Constraint query languages. Journal ofComputer and System Sciences, 51(1):26{52, August 1995.[9] M. Otto and J. Van den Bussche. First-order queries on databases embedded in anin nite structure. Manuscript, 1995.[10] J. Paradaens, J. Van den Bussche, and D. Van Gucht. First-order queries on nitestructures over reals. In Proc. 10th IEEE Symp. on Logic in Computer Science, pages79{87. IEEE Computer Society Press, 1995.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

The Power of Methods With Parallel Semantics

A model capturing the data manipulation capabilities of a large class of methods in ohjectoriented databases is proposed and investsigated. The model uses a deterministic, parallel synchronous semantics with concurrentread and concurrent-write. The results focus on the expressive power of methods and help understand various constructs and semantics associated with methods. Restrictions of metho...

متن کامل

A Visual Approach to Multilinear Recursion1

The problem of expressing complex queries in a friendly way is particularly relevant due to the growing diffusion of databases. However, the most significant proposals for extending the expressive power of the relational query languages are based on the logical paradigm. In particular, an extension of the Horn clause queries, i.e. the so-called stratified Datalog, yields stratified queries, tha...

متن کامل

The Dichotomous Intensional Expressive Power of the Nested Relational Calculus with Powerset

Most existing studies on the expressive power of query languages have focused on what queries can be expressed and what queries cannot be expressed in a query language. They do not tell us much about whether a query can be implemented efficiently in a query language. Yet, paradoxically, efficiency is of primary concern in computer science. In this paper, the efficiency of queries in NRC(powerse...

متن کامل

Theory of Database Queries with Arithmetic Relations

We consider the theory of database queries on a relational data model that includes a set of xed relations used to model arithmetic comparisons and operations. We describe how to extend several natural query languages such as rst-order logic, Datalog, and strati ed Datalog to to apply to databases in this model, and show that their relative expressive power is the same as it is for the standard...

متن کامل

The Expressive Power of Stratified Logic Programs with Value Invention

The expressive power of the family wILOG of relational query languages is investi gated The languages are rule based with value invention and strati ed negation The semantics for value invention is based on Skolem functor terms We study a hierarchy of languages based on the number of strata allowed in programs We rst show that in presence of value invention the class of strati ed programs made ...

متن کامل

Universit a Degli Studi the Expressive Power of Stratiied Logic Programs with Value Invention Programs with Value Invention for Expressing Database Transformations" in International

The expressive power of the family wILOG(:) of relational query languages is investigated. The languages are rule based, with value invention and strati ed negation. The semantics for value invention is based on Skolem functor terms. We study a hierarchy of languages based on the number of strata allowed in programs. We rst show that, in presence of value invention, the class of strati ed progr...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1995